#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include "zlog.h"
#include "yys_msg.h"
#include "yys_network.h"


void yys_thread_network()
{
    dzlog_debug("yys_thread_network, pid = %d", getpid());
    MSG_NETWORK_SEND_DATA msg_data = {
        .type = MSG_TYPE_NETWORK_TO_CAMERA,
        .data = "yyshark YYDS"
    };

    int msg_key = ftok(MSG_KEY_FILE, MSG_KEY_NETWORK);
    int ret = yys_send_msg(msg_key, (void*)&msg_data, sizeof(msg_data));
    if(ret < 0){
        dzlog_error("network send msg failed.");
        exit(EXIT_FAILURE);
    }

    return;
}